#===============================================================================
# STLPortApp.mk
#===============================================================================

INCLUDES_STLPORT = -I/home/hgsc/include/hgsc.compbio/stlport $(INCLUDES_CC)


# Make sure required library is up to date with stlport and debugging on. 
_stlportlib:
	cd $(CBT_ROOT); make stlport

_faststlportlib:
	cd $(CBT_ROOT); make faststlport

#==============================================
#	Local libraries
#==============================================
#
stlportlocalobjs = $(libtargets:%=$(CBT_DEVEL_LIB)/%.stlport.o)
faststlportlocalobjs = $(libtargets:%=$(CBT_DEVEL_LIB)/%.faststlport.o)


_stlportlocallib: $(stlportlocalobjs)
_faststlportlocallib: $(faststlportlocalobjs)


# Compile Local classes with STLPort
$(CBT_OBJ)/%.stlport.o: %.cc $(libdependencies)
	$(GCC) $(CCFLAGS) -g -D_STLP_DEBUG $(INCLUDES_STLPORT) -c -o $(CBT_OBJ)/$*.stlport.o $*.cc

# Compile Local classes with STLPort
$(CBT_OBJ)/%.faststlport.o: %.cc $(libdependencies)
	$(GCC) $(CCFLAGS) -O3 -D_STLP $(INCLUDES_STLPORT) -c -o $(CBT_OBJ)/$*.faststlport.o $*.cc


%.stlport: %.cc _stlportlib _stlportlocallib
	$(GCC) $(CCFLAGS) -D_STLP_DEBUG -g $(INCLUDES_STLPORT) -c -o $(CBT_OBJ)/$*.stlport.o $*.cc 
	$(GCC) -o $*.stlport $(LIB_PATHS) $(CBT_LIB)/$*.stlport.o $(stlportlocalobjs) -lhgsc-compbio.stlport -lhgsc -lstdc++ -lm -lz -lboost_regex 
	cp -f $*.stlport $(CBT_BIN)
	rm -f $*.stlport

%.faststlport: %.cc _faststlportlib _faststlportlocallib
	$(GCC) $(CCFLAGS) -D_STLP_DEBUG -g $(INCLUDES_STLPORT) -c -o $(CBT_OBJ)/$*.faststlport.o $*.cc 
	$(GCC) -o $*.faststlport $(LIB_PATHS) $(CBT_OBJ)/$*.faststlport.o $(stlportlocalobjs) -lhgsc-compbio.faststlport -lhgsc -lstdc++ -lm -lz -lboost_regex 
	cp -f $*.stlport $(CBT_BIN)
	rm -f $*.stlport
